<%@ include file="/taglibs.jsp"%>

<fmt:message key="date.format" var="df" scope="page"/>

<head>
	<title><fmt:message key="fileList.title"/></title>
	<script type="text/javascript" src="${ctx}/scripts/searchFile_module.js"></script>
</head>

<s:set name="files" value="files" scope="request"/>
<s:set var="fileStatus" value="file.fileStatus"></s:set>
<s:form name="listReturnFileForm" action="listReturnFile" method="post">
<s:select key="file.field" name="fieldId" list="fields" listKey="id" listValue="name" headerKey="%{getText('select.default.key')}" headerValue="%{getText('select.default.value')}"></s:select><br/>
<s:select key="file.category" name="cateId" cssStyle="max-width: 500px !important;" list="catList" htmlId="cateId"  id="cateId" listKey="value" listValue="name" headerKey="%{getText('select.default.key')}" headerValue="%{getText('select.default.value')}"></s:select>   
<tr>
	<td>
        <s:property value="getText('file.id')"/>
    </td>
	<td>
		<s:textfield id="fileId" name="fileId" size="30" theme="simple"/>
	</td>
</tr>
<tr>
	<td>
        <s:property value="getText('file.sender')"/>
    </td>
	<td>
		<s:textfield id="sender" name="sender" size="30" theme="simple"/>
	</td>
</tr>

<tr>
	<td>
	
	<button type="submit" onclick="this.blur()" class="button" name="searchReturnFile" >
					<fmt:message key="button.search.title"></fmt:message>
					<img src="${ctx}/images/btn_search.png" align="left" height="20"
						width="20">
				</button>

	<button type="submit" onclick="this.blur()" class="button" name="reset" >
					<fmt:message key="button.reset.title"></fmt:message>
					<img src="${ctx}/images/btn_undo.png" align="left" height="20"
						width="20">
				</button>
				
	<td></td>
</tr>
</s:form>

<s:set var="item_name" value="%{getText('file.item_name')}" scope="page"></s:set>
<s:set var="items_name" value="%{getText('file.items_name')}" scope="page"></s:set>
<display:table name="files" class="table" requestURI="" id="fileList" pagesize="10" >
	<display:setProperty name="paging.banner.item_name" value="${item_name}"/>
	<display:setProperty name="paging.banner.items_name" value="${items_name}"/>
    <display:column property="submitter" sortable="true" titleKey="file.sender" escapeXml="true">
    </display:column>
    <display:column sortable="true" titleKey="file.inputDate" escapeXml="true">
    	<joda:format value="${fileList.inputDate}" pattern="dd/MM/yyyy"/>
    </display:column>
    <display:column sortable="true" style="width:80px" titleKey="file.outputDate" escapeXml="true">
    	<joda:format value="${fileList.outputDate}" pattern="dd/MM/yyyy"/>
    </display:column>    
    <display:column property="fileStatus.status" sortable="false" titleKey="file.status" escapeXml="true">
    </display:column>
	<display:column style="width:50px;" sortable="false" href="file/confirmReturnFile.html" media="html" paramId="id" paramProperty="id" titleKey="file.return.action" >
        <img src="${ctx}/images/btn_send.png" height="20" width="20" />
	</display:column>
	<display:column style="width:30px" sortable="false" href="${ctx}/file/viewFile.html" media="html" paramId="id" paramProperty="id" titleKey="button.detail.title">
	    Xem
	</display:column>
</display:table>
